package com.cloudxingkong.dianyinke.SlideTimerShaft;
import android.annotation.SuppressLint;
import android.text.format.Time;

import java.text.SimpleDateFormat;
/**
 * Created by ningfei on 2016/5/26.
 */
public class Tool {
    private static final String TimeZone = "Asia/Hong_Kong";
    @SuppressLint("SimpleDateFormat")
    public static String getStringYMDate(Long date) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(date);
        return dateString;
    }
    @SuppressLint("SimpleDateFormat")
    public static String getendYMDate(Long date) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(date);
        return dateString;
    }
    @SuppressLint("SimpleDateFormat")
    public static String getforYMDate(Long date) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(date);
        return dateString;
    }
    public static String now() {
        Time t = new Time(TimeZone);
        t.setToNow();
        return t.format("%Y-%m-%d %H:%M:%S");
    }

}